package cn.geodata.dataview.action;

import java.util.ArrayList;

import cn.geodata.dataview.Fire;
import cn.geodata.dataview.FireFactory;

public class ViewMap {
	public class PathRow{
		private int path;
		private int row;
		
		public int getPath() {
			return path;
		}
		public void setPath(int path) {
			this.path = path;
		}
		public int getRow() {
			return row;
		}
		public void setRow(int row) {
			this.row = row;
		}
	}
	
	private PathRow[] pathrows;
	private double x;
	private double y;
	
	public PathRow[] getPathRows() {
		return this.pathrows;
	}
	
	public double getX(){
		return x;
	}
	
	public double getY(){
		return y;
	}
	
	public String execute() throws Exception {
		FireFactory _factory = new FireFactory();
		
		ArrayList<PathRow> _pathRows = new ArrayList<PathRow>();
		for(Fire _f : (Fire[])_factory.list().toArray(new Fire[0])){
			PathRow _pathRow = new PathRow();
			
			_pathRow.setPath(_f.getPath());
			_pathRow.setRow(_f.getRow());
			
			_pathRows.add(_pathRow);
		}
		this.pathrows = _pathRows.toArray(new PathRow[0]);
		this.x = -100;
		this.y = 40;
		
		return "success";
	}
}
